package com.dyz.leetcode._17_comprehensiveApplication;

import java.util.HashSet;
import java.util.Set;

public class _217_containsDuplicate {
    public boolean containsDuplicate(int[] nums) {
        if(nums.length<=1){return false;}
        Set<Integer> set = new HashSet<>();
        for(int num :nums){
            if(set.contains(num)){
                return true;
            }
            set.add(num);
        }
        return false;
    }

}
